package design.patterns.chainmode.staticchain;

/**
 * @Desc:   抽象 handler
 * @author: cww
 * @DateTime: 2020/6/12 20:46
 */

abstract public class Handler {
    /**
     * 处理方法，调用此方法处理请求
     */
    protected Handler successor;
    public abstract void handleRequest();

    /**
     * 赋值方法，调用此方法设定下家
     * @param successor
     */
    public void setSuccessor(Handler successor){
        this.successor = successor;
    }

    /**
     * 取值
     * @return
     */
    public Handler getSuccessor() {
        return successor;
    }
}
